//
//  ServerProductResModel.swift
//  koolcar
//
//  Created by xiantian on 2023/11/20.
//

import UIKit
import ObjectMapper

class ServerProductResModel: Mappable {
    var code: String?
    var msg: String?
    var data: ServerProductDataModel?
    func mapping(map: Map) {
        code <- map["code"]
        msg <- map["msg"]
        data <- map["data"]
    }
    required init?(map: Map) { }
}

class ServerProductDataModel: Mappable {
    var content: [ServerProductContentModel]?
    var pageNumber : Int?
    var pageSize : Int?
    var total : Int?
    
    func mapping(map: Map) {
        content <- map["content"]
        pageNumber <- map["pageNumber"]
        pageSize <- map["pageSize"]
        total <- map["total"]
    }
    required init?(map: Map) { }
}

class ServerProductContentModel: Mappable {
    var content : String?
    var createdTime : String?
    var delFlag : Int?
    var discountStr : String?
    var expirationDate : Int?
    var id : Int?
    var introduce : String?
    var issueStartTime : String?
    var name : String?
    var price : Int?
    var realPrice : Int?
    var serverDiscount : Int?
    var serverProductType : Int?
    var serverProductTypeStr : String?
    var sn : String?
    var updateById : Int?
    var updateByName : String?
    var urlPicture : String?
    var appUrlIcon: String?
    var selectFlag: Bool = false
    var selectProductBlock: (()->Void)?
    func mapping(map: Map) {
        appUrlIcon <- map["appUrlIcon"]
        content <- map["content"]
        createdTime <- map["createdTime"]
        delFlag <- map["delFlag"]
        discountStr <- map["discountStr"]
        expirationDate <- map["expirationDate"]
        id <- map["id"]
        introduce <- map["introduce"]
        issueStartTime <- map["issueStartTime"]
        name <- map["name"]
        price <- map["price"]
        realPrice <- map["realPrice"]
        serverDiscount <- map["serverDiscount"]
        serverProductType <- map["serverProductType"]
        serverProductTypeStr <- map["serverProductTypeStr"]
        sn <- map["sn"]
        updateById <- map["updateById"]
        updateByName <- map["updateByName"]
        urlPicture <- map["urlPicture"]
    }
    required init?(map: Map) { }
}
